version: "3"
services:
  prometheus:
    image: prometheus:2.9.0
    container_name: prometheus
    ports:
      - 9090:9090
    volumes:
      - /opt/monitor/prometheus/prometheus.yaml:/etc/config/prometheus.yml
      - /data/prometheus:/prometheus
    command:
      - --config.file=/etc/config/prometheus.yml
      - --storage.tsdb.path=/prometheus
      - --storage.tsdb.retention=30d
      - --web.console.libraries=/etc/prometheus/console_libraries
      - --web.console.templates=/etc/prometheus/consoles
      - --web.enable-lifecycle
    restart: always
